<?php
/**
 *+------------------
 * Lflow
 *+------------------
 * Copyright (c) 2023~2030 gitee.com/liu_guan_qing All rights reserved.本版权不可删除，侵权必究
 *+------------------
 * Author: Mr.April(405784684@qq.com)
 *+------------------
 */
declare (strict_types=1);

namespace lflow\entity;

class WorkItem
{
    private string $id;

    /**
     * 流程定义ID
     */
    private string $process_id;

    /**
     * 流程实例ID
     */
    private string $order_id;

    /**
     * 任务ID
     */
    private string $task_id;

    /**
     * 流程名称
     */
    private string $process_name;

    /**
     * 流程实例url
     */
    private string $instance_url;

    /**
     * 流程实例为子流程时，该字段标识父流程实例ID
     */
    private string $parent_id;

    /**
     * 流程实例创建者ID
     */
    private string $creator;

    /**
     * 流程实例创建时间
     */
    private string $order_create_time;

    /**
     * 流程实例结束时间
     */
    private string $order_end_time;

    /**
     * 流程实例期望完成时间
     */
    private string $order_expire_time;

    /**
     * 流程实例编号
     */
    private string $order_no;

    /**
     * 流程实例附属变量
     */
    private string $order_variable;

    /**
     * 任务名称
     */
    private string $task_name;

    /**
     * 任务标识名称
     */
    private string $task_key;

    /**
     * 参与类型（0：普通任务；1：参与者fork任务[即：如果10个参与者，需要每个人都要完成，才继续流转]）
     */
    private int $perform_type;

    /**
     * 任务类型
     */
    private int $task_type;

    /**
     * 任务状态（0：结束；1：活动）
     */
    private int $task_state;

    /**
     * 任务创建时间
     */
    private string $task_create_time;

    /**
     * 任务完成时间
     */
    private string $task_end_time;

    /**
     * 期望任务完成时间
     */
    private string $task_expire_time;

    /**
     * 任务附属变量
     */
    private string $task_variable;

    /**
     * 任务处理者ID
     */
    private string $operator;

    /**
     * 任务关联的表单url
     */
    private string $action_url;
    /**
     * 任务参与者列表
     */
    private array $actor_ids;

    public function getId(): string
    {
        return $this->id;
    }

    public function setId(string $id)
    {
        $this->id = $id;
    }

    public function getOrderNo(): string
    {
        return $this->order_no;
    }

    public function setOrderNo(string $orderNo): void
    {
        $this->order_no = $orderNo;
    }

    public function getProcessId(): string
    {
        return $this->process_id;
    }

    public function setProcessId(string $processId)
    {
        $this->process_id = $processId;
    }

    public function getOrderId(): string
    {
        return $this->order_id;
    }

    public function setOrderId(string $orderId)
    {
        $this->order_id = $orderId;
    }

    public function getTaskId(): string
    {
        return $this->task_id;
    }

    public function setTaskId(string $taskId): void
    {
        $this->task_id = $taskId;
    }

    public function getProcessName(): string
    {
        return $this->processName;
    }

    public function setProcessName(string $processName): void
    {
        $this->process_name = $processName;
    }

    public function getInstanceUrl(): string
    {
        return $this->instance_url;
    }

    public function setInstanceUrl(string $instanceUrl): void
    {
        $this->instance_url = $instanceUrl;
    }

    public function getParentId(): string
    {
        return $this->parent_id;
    }

    public function setParentId(string $parentId)
    {
        $this->parent_id = $parentId;
    }

    public function getCreator(): string
    {
        return $this->creator;
    }

    public function setCreator(string $creator)
    {
        $this->creator = $creator;
    }

    public function getOrderCreateTime(): string
    {
        return $this->order_create_time;
    }

    public function setOrderCreateTime(string $orderCreateTime)
    {
        $this->order_create_time = $orderCreateTime;
    }

    public function getOrderEndTime()
    {
        return $this->order_end_time;
    }

    public function setOrderEndTime(string $orderEndTime): string
    {
        $this->order_end_time = $orderEndTime;
    }

    public function getOrderExpireTime(): string
    {
        return $this->order_expire_time;
    }

    public function setOrderExpireTime(string $orderExpireTime): void
    {
        $this->order_expire_time = $orderExpireTime;
    }

    public function getTaskName(): string
    {
        return $this->task_name;
    }

    public function setTaskName(string $taskName): void
    {
        $this->task_name = $taskName;
    }

    public function getTaskKey(): string
    {
        return $this->task_key;
    }

    public function setTaskKey(string $taskKey): void
    {
        $this->task_key = $taskKey;
    }

    public function getTaskType(): int
    {
        return $this->task_type;
    }

    public function setTaskType(int $taskType)
    {
        $this->task_type = $taskType;
    }

    public function getPerformType(): int
    {
        return $this->perform_type;
    }

    public function setPerformType(int $performType)
    {
        $this->perform_type = $performType;
    }

    public function getTaskState(): int
    {
        return $this->task_state;
    }

    public function setTaskState(int $taskState)
    {
        $this->task_state = $taskState;
    }

    public function getTaskCreateTime(): string
    {
        return $this->task_create_time;
    }

    public function setTaskCreateTime(string $taskCreateTime): void
    {
        $this->taskCreateTime = taskCreateTime;
    }

    public function getTaskEndTime(): string
    {
        return $this->task_end_time;
    }

    public function setTaskEndTime(string $taskEndTime)
    {
        $this->task_end_time = $taskEndTime;
    }

    public function getTaskExpireTime()
    {
        return $this->taskExpireTime;
    }

    public function setTaskExpireTime(string $taskExpireTime)
    {
        $this->task_expire_time = $taskExpireTime;
    }

    public function getOperator(): string
    {
        return $this->operator;
    }

    public function setOperator(string $operator)
    {
        $this->operator = $operator;
    }

    public function getActionUrl(): string
    {
        return $this->action_url;
    }

    public function setActionUrl(string $actionUrl)
    {
        $this->action_url = $actionUrl;
    }

    public function getActorIds(): array
    {
        return $this->actor_ids;
    }

    public function setActorIds(array $actorIds): void
    {
        $this->actor_ids = $actorIds;
    }

    public function getOrderVariable(): string
    {
        return $this->order_variable;
    }

    public function setOrderVariable(string $orderVariable): void
    {
        $this->order_variable = $orderVariable;
    }

    public function getTaskVariable(): string
    {
        return $this->task_variable;
    }

    public function setTaskVariable(string $taskVariable): void
    {
        $this->task_variable = $taskVariable;
    }

    public function getOrderVariableMap(): array
    {
        if (!empty($this->order_variable)) {
            return json_decode($this->order_variable, true);
        }
        return [];
    }

    public function getTaskVariableMap(): array
    {
        if (!empty($this->task_variable)) {
            return json_decode($this->task_variable, true);
        }
        return [];
    }

    public function toString(): string
    {
        return json_encode(get_object_vars($this));

    }

    public function toArray(): array
    {
        return get_object_vars($this);
    }

}